package com.shenzhen.horselive.adapter;

import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.shenzhen.horselive.R;
import com.shenzhen.horselive.beans.ApplyCityHistoryBean;
import com.shenzhen.horselive.beans.ApplyHistory;

import org.jetbrains.annotations.NotNull;

public class ApplyCityHistoryAdapter extends BaseQuickAdapter<ApplyCityHistoryBean.DataBean, BaseViewHolder> {
    public ApplyCityHistoryAdapter(int layoutResId) {
        super(layoutResId);
    }

    @Override
    protected void convert(@NotNull BaseViewHolder baseViewHolder, ApplyCityHistoryBean.DataBean s) {
                   baseViewHolder.setText(R.id.tv_time,s.getCreateTime())
                           .setText(R.id.tv_text,"城市："+s.getProvince()+s.getCity()+s.getDistrict())
                           .setText(R.id.tv_author,s.getApplicationName())
                           .setText(R.id.tv_phone,s.getApplicationPhone()+"");
    //  0：提交待审核；3:审核待支付；2审核拒绝；1:已开通；4:竞拍中；5：已售出；6：已回收
                   switch (s.getStatus())
                   {
                       case 0:
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_wait_confirm);
                           break;
                       case 1:
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_kaitong);
                           break;
                       case 2:
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_refused);
                           break;
                       case 3:
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_wait_pay);
                           break;
                       case 4:
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_confit_ing);
                           break;
                       case 5:
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_type_salled);
                           break;
                       case 6:
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_recovery);
                           break;
                       default:
//                           7是过期未审核已经取消
                           baseViewHolder.setImageResource(R.id.img_type,R.mipmap.ico_cancel);
                           break;
                   }
    }
}
